<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Object.getOwnPropertySymbols()[Symbol下标]  获取 Symbol 内容
        let obj1 = {
            name :'张三',
            [Symbol()] : '50',
            [Symbol()] : '100'
        }

        let s = Object.getOwnPropertySymbols(obj1)[1]
        console.log(s); // Symbol()
        console.log(obj1[s]); // 100

        // 唯一属性
        // let arr = Symbol()
        // console.log(arr);

        let obj = {
            name :Symbol(),
            age :Symbol()
        }
        function fn(type){
            if(type === obj.name){
                console.log('A'); // A
            }else{
                console.log('B'); //
            }
        }
        fn(obj.name)
        fn(obj.age)
    </script>
</body>
</html>